import time

from selenium import webdriver
from selenium.webdriver.common.by import By

d=webdriver.Edge()
## 1）进入http://www.sogou.com

d.get("https://www.sogou.com")
time.sleep(2)

## 2）点击图片进入图片网页
# a=d.find_element(By.LINK_TEXT,'图片')
# a.click()
# time.sleep(2)

## 3）控制台打印下图中的a标签文字
aelments=d.find_elements(By.TAG_NAME,'a')
for ae in aelments[:12]:
    print(ae.text,end=' ')
time.sleep(2)
aelments1=d.find_elements((By.CLASS_NAME,'mnav c-font-normal c-color-t'))

# d=webdriver.Edge()
# 打开然知系统网页：http://127.0.0.1/ranzhi/www/
# d.get("http://127.0.0.1/ranzhi/www/")
# time.sleep(1)

## 1)输入用户名和密码功能  admin 123456
# d.find_element(By.ID,'account').send_keys('admin')
# time.sleep(1)
# d.find_element(By.ID,'password').send_keys('123456')
# time.sleep(1)

## 2)	点击登陆按钮
# button1=d.find_element('id','submit')
# button1.click()
# time.sleep(1)

## 3)	点击后台管理按钮
# button2=d.find_element(By.XPATH,'/html/body/div[1]/div[1]/div/ul[1]/li[8]/button')
# button2.click()
# time.sleep(1)

# button2=d.find_element('id','s-menu-superadmin')
# button2.click()
# time.sleep(1)
